package com.example.qxfw.sjjk.service.impl;

import com.example.qxfw.sjjk.entity.dto.DataMonitoringDto;
import com.example.qxfw.sjjk.entity.vo.DataMonitoringVo;
import com.example.qxfw.sjjk.mapper.DataMonitoringMepper;
import com.example.qxfw.sjjk.service.DataMonitoringScervice;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class DataMonitoringScerviceImpl implements DataMonitoringScervice {

    private final DataMonitoringMepper dataMonitoringMepper;


    @Override
    public List<DataMonitoringVo> getDataMonitoring(String monitoradvcode) {
        List<DataMonitoringVo> dataMonitoring = dataMonitoringMepper.getDataMonitoring(monitoradvcode);
        return dataMonitoring;
    }

    @Override
    public void updateDataMonitoring(DataMonitoringDto dataMonitoringDto) {

        String monitorName = dataMonitoringDto.getMonitorName();
        String standardBasis = dataMonitoringDto.getStandardBasis();
        Double contrastValue = dataMonitoringDto.getContrastValue();
        Integer status = dataMonitoringDto.getStatus();
        String monitoradvcode = dataMonitoringDto.getMonitoradvcode();

        dataMonitoringMepper.updateDataMonitoring1(monitorName, standardBasis, contrastValue, status, monitoradvcode);
//        dataMonitoringMepper.updateDataMonitoring(dataMonitoringDto);
    }


}
